import request from '@/utils/request';
const api_name = '/rent';

export default {
  // 通过房源ID和用户ID查询一个租赁
  getRentById(houseId, userId) {
    return request({
      url: `${api_name}/${houseId}/${userId}`,
      method: 'get'
    });
  },
  // 根据房源ID和用户ID删除一个租赁
  removeRentById(houseId, userId) {
    return request({
      url: `${api_name}/${houseId}/${userId}`,
      method: 'delete'
    });
  },
  // 新增一个租赁
  saveRent(houseId, userId) {
    return request({
      url: `${api_name}/${houseId}/${userId}`,
      method: 'post'
    });
  },
  // 查询"我的"租赁
  getRent(userId){
    return request({
      url: `${api_name}/${userId}`,
      method: 'get'
    });
  }
};
